package com.tusuo.stds.util;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Display;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;

import com.tusuo.stds.R;

/**
 * Created by developer on 17-5-3.
 */

public class PicDeleteDialog extends Dialog {

    Context con;
    View.OnClickListener deleteClickListener;

    public PicDeleteDialog(Context context) {
        super(context);
        con = context;
    }

    public PicDeleteDialog(Context context, int themeResId) {
        super(context, themeResId);
        con = context;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        init();
    }

    public void setOnDeleteClickListener(View.OnClickListener deleteClickListener) {
        this.deleteClickListener = deleteClickListener;
    }


    private void init() {
        View view = LayoutInflater.from(con).inflate(R.layout.dialog_delete_pic,null);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏
        setContentView(view);

        Button btnDelete = (Button) view.findViewById(R.id.dialog_pic_delete);

        Button btnCancel = (Button) view.findViewById(R.id.dialog_pic_cancel);

        btnDelete.setOnClickListener(deleteClickListener);

        btnCancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });

    }


}
